import { createApp } from 'vue'
import { createPinia } from 'pinia' // 引入 Pinia
import router from './router'
import App from './App.vue'

// Element Plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// Vant
import Vant from 'vant'
import 'vant/lib/index.css'

// 全局样式
import './style.css'

const app = createApp(App)
const pinia = createPinia() // 创建 Pinia 实例

// 注册 Element Plus 图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(pinia) // 使用 Pinia
app.use(router)
app.use(ElementPlus)
app.use(Vant)

app.mount('#app')
